package com.ccp.dev.workflow.model;

import com.ccp.dev.core.basic.model.BaseModel;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import java.util.Date;
import java.util.Objects;

/**
 * 对象功能:流程流转状态
 * @author :wangtao
 * @date :2017-7-24
 */
public class BpmProTransTo extends BaseModel<BpmProTransTo> {
    /**
     * 主键
     */
    protected String id;
    /**
     * 任务id
     */
    protected String taskId;
    /**
     * 流程实例id
     */
    protected String procInstId;
    /**
     * 流转类型(1,非会签,2,会签)
     */
    protected Integer transType;
    /**
     * 执行后动作(1,返回,2,提交)
     */
    protected Integer action;
    /**
     * 发起人ID
     */
    protected String createUserId;
    /**
     * 创建时间
     */
    protected Date createTime;
    /**
     * 被流转人投票结果,1同意,2反对
     */
    protected Integer transResult;
    /**
     * 流转接收人
     */
    protected String assignee;

    //流程相关
    /**
     * 流程实例runId
     */
    protected String runId;
    /**
     * 流程实例标题
     */
    protected String subject;
    /**
     * 流程名称
     */
    protected String processName;

    /**
     * 类型
     */
    protected String typeId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getProcInstId() {
        return procInstId;
    }

    public void setProcInstId(String procInstId) {
        this.procInstId = procInstId;
    }

    public Integer getTransType() {
        return transType;
    }

    public void setTransType(Integer transType) {
        this.transType = transType;
    }

    public Integer getAction() {
        return action;
    }

    public void setAction(Integer action) {
        this.action = action;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getTransResult() {
        return transResult;
    }

    public void setTransResult(Integer transResult) {
        this.transResult = transResult;
    }

    public String getAssignee() {
        return assignee;
    }

    public void setAssignee(String assignee) {
        this.assignee = assignee;
    }

    public String getRunId() {
        return runId;
    }

    public void setRunId(String runId) {
        this.runId = runId;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getProcessName() {
        return processName;
    }

    public void setProcessName(String processName) {
        this.processName = processName;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {return true;}
        if (o == null || getClass() != o.getClass()) {return false;}
        BpmProTransTo that = (BpmProTransTo) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(taskId, that.taskId) &&
                Objects.equals(procInstId, that.procInstId) &&
                Objects.equals(transType, that.transType) &&
                Objects.equals(action, that.action) &&
                Objects.equals(createUserId, that.createUserId) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(transResult, that.transResult) &&
                Objects.equals(assignee, that.assignee) &&
                Objects.equals(runId, that.runId) &&
                Objects.equals(subject, that.subject) &&
                Objects.equals(processName, that.processName) &&
                Objects.equals(typeId, that.typeId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, taskId, procInstId, transType, action, createUserId, createTime, transResult, assignee, runId, subject, processName, typeId);
    }

    @Override
    public String toString() {
        return "BpmProTransTo{" +
                "id='" + id + '\'' +
                ", taskId='" + taskId + '\'' +
                ", procInstId='" + procInstId + '\'' +
                ", transType=" + transType +
                ", action=" + action +
                ", createUserId='" + createUserId + '\'' +
                ", createtime=" + createTime +
                ", transResult=" + transResult +
                ", assignee='" + assignee + '\'' +
                ", runId='" + runId + '\'' +
                ", subject='" + subject + '\'' +
                ", processName='" + processName + '\'' +
                ", typeId='" + typeId + '\'' +
                '}';
    }
}
